#ifndef LightPass_h__
#define LightPass_h__

#include "Common/CommonTypes.h"
#include "BassPass.h"
#include "RenderObject.h"

class CD3DEffect;
class CLightPass : public CBasePass
{
public:
	CLightPass();
	virtual ~CLightPass();

public:
	void Init();
	void UnInit();
	void BeginRender();	
	void Render(std::vector<CRenderObject*> *pRenderObjs);

	void EndRender();

	ID3D10EffectTechnique* GetLightTech() { return m_pLightTech; }

private:
	void _BuildLightEffect();
	void _BuildVertexLayouts();
	void _DrawMeshRenderObj(CMeshRenderObject* pMeshRenderObj);
private:
	CD3DEffect*                     m_pEffect;
	ID3D10Effect*                   m_pLightEffect;
	ID3D10EffectTechnique*          m_pLightTech;
	ID3D10EffectMatrixVariable*     m_pWVPVar;
	ID3D10EffectMatrixVariable*     m_pWorldVar;
	ID3D10EffectVariable*           m_pEyePosVar;
	ID3D10EffectVariable*           m_pLightVar;
	ID3D10EffectScalarVariable*     m_pLightType;

	ID3D10InputLayout*              m_pVertexLayout;

	CMatrix                         m_mViewProjMat;
};
#endif // LightPass_h__
